import Vue from 'vue'
import 'normalize.css/normalize.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'

import store from './store'

import router from './router'

import '@/permission.js'

// import '@/directive'

import directivePlugin from './directive'
Vue.use(directivePlugin)

import '@/icons' // icon

Vue.use(ElementUI)

Vue.config.productionTip = false

// 注册为全局组件
// import PageTools from '@/components/PageTools'
// Vue.component(PageTools.name, PageTools)
import componentPlugin from '@/components'
Vue.use(componentPlugin)

// vue实例化
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App) // 类比为template模板，吧app组件跟组件进行渲染挂载，app根组件一旦渲染就会生成一个dom树状，底层所有的子孙组件也会渲染
})
